"""
Grids module for PDEJulia.jl

Provides spatial discretization capabilities including Cartesian, spherical, and cylindrical grids.
This module defines the grid infrastructure for solving PDEs on regular, orthogonal domains.

# Grid Types
- `UnitGrid`: Simple equidistant grid on [0,1]^d
- `CartesianGrid`: General Cartesian grid with arbitrary bounds
- `PolarSymGrid`: Polar coordinates with angular symmetry
- `SphericalSymGrid`: Spherical coordinates with spherical symmetry
- `CylindricalSymGrid`: Cylindrical coordinates with cylindrical symmetry

# Features
- Automatic boundary condition handling
- Efficient operator implementations (Laplacian, gradient, etc.)
- Support for different grid geometries and symmetries
- Integration with differential operators
- Parallel computing support
"""
module Grids

using LinearAlgebra
using SparseArrays
using StaticArrays
using FFTW

# Include all grid implementations
include("base.jl")
include("boundaries.jl")
include("cartesian.jl")
include("spherical.jl")
include("cylindrical.jl")
include("operators.jl")

# Export types
export AbstractGrid, AbstractCartesianGrid, AbstractSphericalGrid
export UnitGrid, CartesianGrid
export PolarSymGrid, SphericalSymGrid, CylindricalSymGrid

# Export boundary conditions
export BoundaryCondition, NeumannBC, DirichletBC, PeriodicBC, MixedBC
export get_boundary_conditions, set_boundary_conditions!

# Export grid functions
export grid_laplace, grid_gradient, grid_divergence, grid_curl
export get_axis, get_line, get_random_point
export iter_mirror_points, get_image_data

# Export advanced grid functions
export coordinate_range, cell_coordinates, grid_coordinates
export contains_point, closest_index
export get_boundary_indices, get_ghost_cell_indices, add_ghost_cells
export integrate_simpson, integrate_trapezoidal, interpolate_linear
export get_line_data, get_cross_section
export refine, coarsen
export periodic_distance

# Export operators
export make_laplace_operator, make_gradient_operator
export make_divergence_operator, make_curl_operator

end # module Grids